﻿@inject IStringLocalizer<InputGroupsSelect> Localizer
@inject IStringLocalizer<Foo> LocalizerFoo

<div>
    <div class="row g-3">
        <div class="col-12 col-sm-6">
            <BootstrapInputGroup>
                <BootstrapInputGroupLabel DisplayText="@Localizer["InputGroupsSelectUserName"]" />
                <Select TValue="string" Items="@Items"></Select>
            </BootstrapInputGroup>
        </div>
        <div class="col-12 col-sm-6">
            <BootstrapInputGroup>
                <Select TValue="string" Items="@Items"></Select>
                <BootstrapInputGroupLabel DisplayText="@Localizer["InputGroupsSelectUserName"]" />
            </BootstrapInputGroup>
        </div>
    </div>
</div>
@code {
    /// <summary>
    /// Foo 类为Demo测试用，如有需要请自行下载源码查阅
    /// Foo class is used for Demo test, please download the source code if necessary
    /// https://gitee.com/LongbowEnterprise/BootstrapBlazor/blob/main/src/BootstrapBlazor.Shared/Data/Foo.cs
    /// </summary>
    [NotNull]
    private Foo? Model { get; set; }

    private readonly IEnumerable<SelectedItem> Items = new SelectedItem[]
    {
        new SelectedItem ("", "请选择 ..."),
        new SelectedItem ("Beijing", "北京"),
        new SelectedItem ("Shanghai", "上海")
    };

    /// <summary>
    /// OnInitialized 方法
    /// </summary>
    protected override void OnInitialized()
    {
        Model = Foo.Generate(LocalizerFoo);
    }
}
